#@tabLayout()

#define css()
<link href="#(assetsUrl)/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
#end

#define main()
<div class="page-container">
	<form action="#(baseUrl)/teacher/save" method="post" class="form form-horizontal" id="form-teacher-save">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>职工号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="#(teacher.Teacher_ID??)" placeholder="" id="id_field" name="Teacher_ID" #(teacher!=null?'readonly':'')>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">姓名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="#(teacher.Teacher_name??)" placeholder="" id="name_field" name="Teacher_name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">性别：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" name="Sex" id="sex_field" placeholder="请输入性别" value="#(teacher.Sex??)" class="input-text" style=" width:25%">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">生日：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" name="Birthday" id="birth_field" placeholder="" value="#(teacher.Birthday??)" class="input-text">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">年龄：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" name="Age" id="age_field" placeholder="请输入年龄" value="#(teacher.Age??)" class="input-text" >
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">职位：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" name="Position" id="position_field" placeholder="请输入职位" value="#(teacher.Position??)" class="input-text" >
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">电话：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" name="Phone" id="phone_field" placeholder="请输入电话" value="#(teacher.Phone??)" class="input-text" >
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">籍贯：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" name="City" id="city_field" placeholder="请输入籍贯" value="#(teacher.City??)" class="input-text" >
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> #(teacher == null? '添加' : '保存')</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>
#end

#define js()
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="#(assetsUrl)/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="#(assetsUrl)/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="#(assetsUrl)/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="#(assetsUrl)/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">

$("#form-teacher-save").submit(function(e){
	var postData = $(this).serializeArray();
	var formUrl = $(this).attr("action");
	$.ajax({
		url: formUrl,
		type: "POST",
		data: postData,
		success:function(data){
			$.Huimodalalert('保存成功',500);
			setTimeout("layer_close()",500);
		},
		error:function(jqXHR, textStatus, errorThrown){
			$.Huimodalalert('保存失败',2000);
		}
	});
	e.preventDefault(); //STOP default action
});
</script>
#end